<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="keywords" content="">
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>微信在线投票系统</title>
<link rel="stylesheet" href="css/reset.css"/>
<script src="js/jquery-2.1.1.min.js"></script>


<script type="text/javascript">

  var isSuccess = 1;
	  
  function nameCheck(){
	  
	  var txt_name = $.trim($("#name").val());
	  
	  if( txt_name.length == 0)
      {   
		  isSuccess = 0 ;
		  $("#errorInfo").text("请输入名字！");
      } else {
    	  isSuccess = 1 ;
      }
  }
  
  function sectionCheck(){
	  var txt_hospital = $.trim($("#section").val() );
		  
	  if( txt_hospital.length == 0)  
      {  
		  isSuccess = 0 ;
          $("#errorInfo").text("请输入部门！");
      }else {
    	  isSuccess = 1 ;
      }
  }

$(document).ready(function(){
	
    $("#registerID").bind("submit", function(){
		
    	nameCheck();
    	if(isSuccess == 0)  
        {  
            return false;  
        }
        	
    	sectionCheck();
    	if(isSuccess == 0)  
        {  
            return false;  
        }	
		        
        })
})



</script>

</head>	
<body>
<div class="logo"></div>
<div class="tit"></div>
<div class="box">
  <form method="post" action="loginAndRegister" id="registerID">
	 <div class="box_input">
	   <p style="color: #0c60a6">姓名</p>
	   <span><input id="name" name="name" type="text" placeholder="" /></span>
	 </div>
	 <div class="box_input">
	   <p style="color: #0c60a6">电话</p>
	   <span><input id="section" name="section" type="text" placeholder="" /></span>
	 </div>
	 <div class="box_info"><span id="errorInfo"></span></div>
	 <div class="box_submit"><input  type="submit" value="登 录"  /></div>
  </form>
</div>
</body>
</html>
